package cn.edu.scau.cmi.liangzijian.hibernate.domain;

import java.io.Serializable;

public class Student implements Serializable {
	private int id;
	private String name;
	private Teacher teacher;
	
	public Student() {
	}
	
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	
	public Teacher getTeacher() {
		return teacher;
	}
	
	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	@Override
	public String toString() {
		StringBuilder strBuilder = new StringBuilder();
		
		strBuilder.append("Id: " + id + "    名字: " + name);
		if(teacher != null)
			strBuilder.append("     导师: ( " + teacher + " )");
		
		return strBuilder.toString();
	}
}
